1. Filed of the Invention
The present invention relates to an image processing method and apparatus having a data compression function that applies to an image forming apparatus such as, for example, a digital photocopier and a printing system, and more particularly relates to an image processing method and apparatus that select a data compression method according to a size of an output image of the inputted image data.
2. Discussion of the Background
In general, image processing apparatuses that apply to image forming apparatuses such as a digital photocopier have an image data memory for storing inputted image data to rotate the image data for changing the direction of an image of the image data, for example, from a landscape orientation into a portrait orientation and vice versa. The image processing apparatuses input original image data inputted from, for example, an external inputting device such as an image scanning device, stores the data into the image data memory, rotates the image data, and then outputs the rotated image data to an external outputting device such as a printing device. In order to decrease the size or the capacity of the image data memory, the image processing apparatus generally compresses the image data before storing the data into the image data memory.
For a high-fidelity image reproduction, an image processing apparatus of a digital photocopier generally separates image data input from an image scanning device into three categories, a text area, a screened halftone image area and a continuous tone image area, so as to process each of the separated image areas in appropriate manners, respectively. For example, the image processing apparatus provides plural spatial filters and gradation converters, and applies adequate ones of the filters and gradation converters for each of the separated image areas. The above separating operation generates data defining a category for each of the picture elements structuring the input image, and hereinafter, such data is referred to as segmentation data. The segmentation data is temporarily stored in a memory, and hereinafter, the memory is referred to as a segmentation data memory. When the image data in the image data memory is rotated for changing the direction of the image, for example, from a landscape orientation to a portrait orientation, the segmentation data in the segmentation data memory is also rotated for enabling a swift access to the segmentation data. For decreasing the capacity of the segmentation data memory, the segmentation data is also generally compressed before being stored in the memory.
In a digital color photocopier, an image editing, such as a color change inside a specified region of an original document, is generally practiced. Data for editing an image, such as editing instructions for each picture element of the input image data, is temporarily stored in a memory so as to be used during the image editing operation. The data for editing the image and the memory for storing the data are hereinafter referred as editing data and an editing data memory. When the image data in the image data memory is rotated, the editing data in the editing data memory is also rotated for enabling swift access to the editing data. For decreasing the capacity of the editing data memory, the editing data is generally compressed before being stored in the memory.
A digital color photocopier is desired to provide an image processing apparatus having a function of recognizing an article that is forbidden by law to be reproduced, such as, bills, securities and so forth, and inhibiting an ordinary reproduction thereof. For recognizing such an article, the image processing apparatus first extracts features of an input image and temporarily stores the extracted feature data in a memory. Then, the image processing apparatus analyzes the extracted feature data and judges whether the article is legal to be reproduced. The extracted feature data is generally compressed before being stored in the memory for efficiency of space usage.
Image data compression methods are classified broadly into two categories according to a compressed data length-fixed-length data compression methods and variable-length data compression methods. In general, a variable-length data compression method yields higher compressibility than the fixed-length data compression method. The Block Truncation Coding (xe2x80x9cBTCxe2x80x9d) method is a known exemplary fixed-length data compression method. A fixed-length data compression method yields swift memory access because the location of a picture element and an address in which the data of the picture element is stored are kept in a linear relationship. Therefore, when image data is compressed by the fixed-length data compression method, an image rotating operation is swiftly accomplished. However, compressibility or a compression ratio of the fixed-length data compression method, which is measured by a ratio of the compressed data size to the original data size, is relatively small. The compression ratio of the BTC method is, for example, 0.6.
The Joint Photographic Expert Group (xe2x80x9cJPEGxe2x80x9d) method is a known exemplary variable-length data compression method. A variable-length data compression method yields a high compression ratio, but compressed data length is not a constant value. Therefore, to access compressed data in a memory, the address where the data is stored must be calculated. Accordingly, if image data is compressed by the variable-length data compression method, an operating time for the rotation of the compressed data generally becomes too long for practical use in a digital photocopier. The compression ratio of the variable-length data compression method is varied according to contents of an image data, however it can be limited to a certain value. For example, the compression ratio of the JPEG method can be limited to 0.4.
Japanese Patent No. 2618988 describes a system having a fixed-length data compression device. In the system, original image data is compressed into fixed-length data by the fixed-length data compressing device, then the compressed data is stored in an image data memory device. Thus, the capacity of the image data memory device is relatively large.
Image data compression methods are also classified into two categories according to reversibility between original data and compressed data-reversible compression methods and irreversible compression methods. When data that has been compressed by a reversible compression method is expanded, the expanded data exactly accord with the original data. When data that has been compressed by an irreversible compression method is expanded, the expanded data is slightly different from the original data. Both the BTC method and the JPEG method are irreversible compression methods. The Huffman encoding method is a known exemplary reversible data compression method which is also classified as a variable-length data compression. Generally, an irreversible compression method has higher compressibility than a reversible compression method. The compression ratio of the Huffman encoding method is varied according to contents of image data, however it can be limited to a fixed value such as, for example, 0.5.
Image data may be compressed by a reversible compression method or an irreversible compression method depending upon a desired image quality of an image reproduction. When image data is required to be rotated, hitherto one of the fixed-length data compression methods is generally used for a swift rotating operation of the image data. Further, generally in order to make an image processing apparatus in a simple configuration, a single method, i.e., a fixed-length data compression method is used for compression, regardless of the sizes of an input image. Consequently, the capacity of the image memory is required to be large enough to store an image of the largest size. Further, in order to construct an image processing apparatus in a simple configuration, even when the data size of an original document is small enough to be stored in the image memory without compression, the original document data is generally automatically compressed, and thereby an operating time for the data compression is wasted.
On the other hand, it is desirable to compress segmentation data and editing data by one of the reversible compression methods in order to reproduce an image while maintaining high fidelity of an image reproduction and accuracy of editing an image. In addition, when image data is rotated, segmentation data and editing data for the image data are also required to be rotated. Accordingly, one of the fixed-length data compression methods is generally used for segmentation data and editing data for accomplishing a swift rotating operation of the segmentation data and editing data. Consequently, hitherto a reversible and fixed-length data compression method is generally used for compressing segmentation data and editing data.
When segmentation data and editing data are compressed by a reversible fixed-length data compression method, access to the segmentation data or the editing data for either writing data into the memory or reading data out from the memory during an image rotating operation, is swiftly accomplished without complex address calculation.
However, because the reversible fixed-length data compression method has a low compression ratio, the capacities of a segmentation data memory and an editing data memory, respectively, are required to be relatively large. Further, in order to construct an image processing apparatus in a simple configuration, even when segmentation data or editing data is small enough to be stored in the segmentation memory or the editing data memory without data compression, the data is generally automatically compressed and then stored in the memory. Thus, segmentation data and editing data are always compressed regardless of the sizes of the data. Accordingly, when segmentation data and editing data are small enough to be stored in respective memories without data compression, an operating time for the data compression is wasted.
Accordingly, one object of the present invention is to provide a novel image processing method and apparatus which have a function of data compression and which are capable of decreasing a capacity of an image data memory and decreasing an image processing time.
Another object of the present invention is to provide a novel image processing method and apparatus which have a function of data compression and which are capable of decreasing a capacity of an editing data memory and decreasing an image processing time.
Another object of the present invention is to provide a novel image processing method and apparatus which have a function of data compression and which are capable of decreasing a capacity of an image segmentation data memory and decreasing an image processing time.
According to the preferred embodiment of the present invention, an image processing apparatus for inputting image data from an external image inputting device and outputting the inputted image data to an external image outputting device after processing the data, includes a data compression device for compressing the inputted image data by a variable-length data compression method. An image data storing device stores the inputted image data therein. A control device controls the apparatus, such that, when a size of an output image of the inputted image data is larger than a predetermined size, the data compression device compresses the inputted image data by the variable-length data compression method and the image data storing device stores the compressed image data therein, and, when the output image of the inputted image data is equal to or smaller than the predetermined size, the image data storing device stores the inputted image data therein without data compression.